//s = "AUBTMKAxfuu"
//s = "KKuuUuUuKKKKkkkkKK"
s = "AUBTMKAxfuu"
function solution(s) {
    let Hash = {
        K: 0,
        k: 0,
        U: 0,
        u: 0,
    }
    for (let value of s) {
        if (!Hash[value]) {
            Hash[value] = 1
        } else {
            Hash[value]++
        }
    }
    //console.log(Hash);
    let res = Math.min(Hash.K + Hash.k, Hash.U + Hash.u)
    return res
}
console.log(solution(s));
